import request from '@/config/axios'

export function getAllItemApi() {
	return request.post<GItem[]>({
		url: '/game/g-recipe/readOnly/getAllItem',
	})
}

export function getAllBuildingApi() {
	return request.post<GBuilding[]>({
		url: '/game/g-recipe/readOnly/getAllBuilding',
	})
}

export function getAllProductionBuildingApi() {
	return request.post<GBuilding[]>({
		url: '/game/g-recipe/readOnly/getAllProductionBuilding',
	})
}

export function saveRecipeForItemApi(data: SaveRecipeRequest) {
	return request.post({
		url: '/game/g-recipe/saveRecipeForItem',
		data
	})
}

export function saveRecipeForBuildingApi(data: SaveRecipeRequest) {
	return request.post({
		url: '/game/g-recipe/saveRecipeForBuilding',
		data
	})
}

export function deleteRecipeApi(id: number) {
	return request.delete({
		url: '/game/g-recipe/deleteRecipe/' + id,
	})
}
